package com.example.day_blog.utils;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RestController;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @author starsea
 * @date 2024-01-18 17:48
 * 日期工具类
 */
@RestController
public class DateUtils {
    public static String formatDate(Date date)
    {
        SimpleDateFormat simpleDateFormat=new SimpleDateFormat("yyyy-MM-dd HH:mm");
        return simpleDateFormat.format(date);
    }

}
